﻿//-----------------------------------------------------------------------
// <copyright file="NhRepositoryBaseTestFixture.cs" company="OverrideThis">
//     Copyright (c) 2010 OverrideThis.com
// </copyright>
//-----------------------------------------------------------------------
namespace OverrideThis.Core.Tests.Infrastructure.Repository
{
    using NUnit.Framework;
    using OverrideThis.Core.Infrastucture.Repository;
    using OverrideThis.Core.Infrastucture.Repository.Impl;
    using OverrideThis.Core.Tests.Infrastructure.Repository.Impl.Cfg;

    public class NhRepositoryBaseTestFixture
    {
        protected IRepository Repository { get; private set; }
        
        [TestFixtureSetUp]
        public void FixtureSetUp()
        {
            var sessionFactory = new NhSessionFactory(new TestNhSessionFactoryCfg());
            sessionFactory.UseInMemoryDatabase();
            sessionFactory.BuildSchema();
            this.Repository = new NhRepository(sessionFactory.Get());
        }
    }
}
